<template>
    <div style="margin-top:20px;width:750px;">
        <p style="margin-bottom:20px;">不用form表单的表单控件</p>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="用户">
                <el-checkbox-group v-model="form.user">
                    <el-checkbox label="国家" name="gj"></el-checkbox>
                    <el-checkbox label="手机" name="sj"></el-checkbox>
                    <el-checkbox label="水果" name="sg"></el-checkbox>
                    <el-checkbox label="饮料" name="yl"></el-checkbox>
                </el-checkbox-group>
            </el-form-item>
            <el-col :span="12" >
                <el-form-item label="国家" v-if="form.user.includes('国家')" label-width="50px">
                    <div style="display:flex;">
                        <el-select style="width:100px;" v-model="form.country" placeholder="请选择你的国家">
                            <el-option label="中国" value="China"></el-option>
                            <el-option label="美国" value="American"></el-option>
                        </el-select>
                        <div v-if="form.country === 'China'">
                            <el-input style="margin-left:12px;" v-model="form.countryInfo"></el-input>
                        </div>
                    </div>
                </el-form-item>
            </el-col>
            <el-col :span="12" v-if="form.user.includes('手机')">
                <el-form-item label="手机">
                    <div style="display:flex;">
                        <el-select style="margin-right:12px;width:100px;" v-model="form.phone" placeholder="请选择你喜爱的手机">
                            <el-option label="华为" value="huawei"></el-option>
                            <el-option label="小米" value="xiaomi"></el-option>
                        </el-select>
                        <div v-if="form.phone === 'huawei'">
                        <el-input v-model="form.phoneInfo"></el-input>
                        </div>
                    </div>

                </el-form-item>
            </el-col>
            <el-col :span="12">
                <el-form-item label="水果"  v-if="form.user.includes('水果')">
                    <div style="display:flex;">
                        <el-select style="margin-right:12px;width:164px;" v-model="form.fruit" placeholder="请选择最喜爱的水果">
                            <el-option label="苹果" value="apple"></el-option>
                            <el-option label="香蕉" value="banana"></el-option>
                        </el-select>
                        <el-input v-model="form.fruitInfo"></el-input>
                    </div>
                </el-form-item>
            </el-col>
            <el-col :span="12" v-if="form.user.includes('饮料')">
                <el-form-item label="饮料"  >
                    <div style="display:flex;">
                        <el-select style="margin-right:12px;width:164px;" v-model="form.drink" placeholder="请选择最喜爱的饮料">
                            <el-option label="茶" value="tea"></el-option>
                            <el-option label="咖啡" value="coffer"></el-option>
                        </el-select>
                        <el-input v-model="form.drinkInfo"></el-input>
                    </div>
                </el-form-item>
            </el-col>
        </el-form>
    </div>
</template>

<script>
export default {
    data() {
        return {
            form: {
                user:[],
                country: '',
                phone: '',
                fruit: '',
                drink: '',
                countryInfo: '',
                phoneInfo: '',
                fruitInfo: ''
            }

        }
    },
    methods: {

    },
    created() {

    },
}
</script>
